package com.hopes.bizz.risk.statistic.vo;

import com.hopes.bizz.risk.common.constant.enums.RiskSysDictEnum;
import com.hopes.boss.admin.api.entity.SysDictItem;
import com.hopes.boss.admin.api.resolver.DictResolver;
import lombok.Data;

import java.io.Serializable;
import java.util.Optional;

/**
 * @author yumr
 * @Description 风险等级分类
 * @time 2023/8/8 18:07
 */
@Data
public class RiskLevelClassifyVO implements Serializable {

    private static final long serialVersionUID = -8739039740395193799L;

    /**
     * 数量
     */
    private Integer count;

    /**
     * 现状风险等级
     */
    private String riskLevel;


    public SysDictItem getRiskLevel() {
        return DictResolver.getItemByValue(RiskSysDictEnum.risk_level, Optional.ofNullable(this.riskLevel).orElse(null));
    }
}
